package org.yzhzc.job.service.message.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.yzhzc.job.domain.message.entity.MessageText;
import org.yzhzc.job.mapper.message.MessageTextMapper;
import org.yzhzc.job.service.message.IMessageTextService;

import java.util.List;

@Service
@Slf4j
public class MessageTextServiceImpl extends ServiceImpl<MessageTextMapper, MessageText> implements IMessageTextService {

    /**
     * 批量插入消息文本
     *
     * @param messageTextList 待插入的消息文本列表
     * @return 插入是否成功，成功返回 true，失败返回 false
     */
    @Override
    public boolean batchInsert(List<MessageText> messageTextList) {
        // 调用 MyBatis-Plus 提供的 saveBatch 方法进行批量插入操作
        // saveBatch 会自动进行批量插入并处理事务、性能等问题
        return saveBatch(messageTextList);
    }
}
